# !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time    : 2021/12/21 14:34
# @Author  : zuodengbo
# @Email   : zuodb@amoydx.com
# @File    : models
# @Software: PyCharm
from tortoise.models import Model
from tortoise import fields

from utils.common import time_now


class AbstractBaseModel(Model):
    id = fields.IntField(pk=True, description="主键标识")

    class Meta:
        abstract = True


class TimeMixin(object):
    create_time = fields.DatetimeField(auto_now_add=True, default=time_now(), description="创建时间")
    update_time = fields.DatetimeField(null=True, description="更新时间")

